package ZhengZe;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegMain
{
	public static void main(String[] args)
	{
		System.out.println("====");
		System.out.println(test("[a-z]","d"));
		System.out.println(teste("[\\W]", "a"));
		System.out.println(test(" "," "));
		System.out.println();
	}

	private static boolean test(String a , String b)
	{
		Boolean rseult = false;
		Pattern patt = Pattern.compile(a);
		Matcher matcher = patt.matcher(b);
		rseult = matcher.matches();
		return rseult;
	}
	public static boolean teste (String a , String b) 
	{
		Pattern pa = Pattern.compile(a);
		Matcher ma = pa.matcher(b);
		return ma.matches() ;
	}
}
